const path = require('path')
const fileUtils = require('../utils/file_utils')
module.exports = async (ctx, next) => {
  // 获取 url
  // const url = ctx.requset.url
  // let filePath = url.replace('/api', '')
  // filePath = '../data' + filePath + 'json'
  // filePath = path.join(__dirname, filePath)
  try {
    // const ret = fileUtils.getFileJsonData(filePath)
    ctx.response.body = 'nihaoa'
  } catch (error) {
    const errorMsg = {
      message: 'error',
      status: 404
    }
    ctx.response.body = errorMsg
  }
  await next()
}